home *** CD-ROM | disk | FTP | other *** search
/ Champak 40 / Vol 40.iso / games / water_ba.swf / scripts / frame_10 / DoAction.as
Encoding:
Text File  |  2007-03-21  |  3.9 KB  |  169 lines

  1. function bubblenote()
  2. {
  3. }
  4. function captionbutton()
  5. {
  6.    switch(this.name)
  7.    {
  8.       case "demo":
  9.          this.pos = 2;
  10.          break;
  11.       case "full":
  12.          this.pos = 1;
  13.    }
  14. }
  15. stop();
  16. _root.flipper.removeMovieClip();
  17. if(_root.version === "web")
  18. {
  19.    gotoAndStop(14);
  20.    _root.timesplayed._visible = false;
  21. }
  22. _root.timesplayed = "YOU HAVE " + (15 - myLocalSO.data.plays) + " PLAYS LEFT";
  23. Object.registerClass("bubblenote",bubblenote);
  24. Object.registerClass("text_demobuttonbig2",captionbutton);
  25. Object.registerClass("register_button",captionbutton);
  26. bubblenote.prototype = new MovieClip();
  27. captionbutton.prototype = new MovieClip();
  28. _quality = "low";
  29. attachMovie("text_demobuttonbig2","demo",4,{_x:800,_y:330,name:"demo"});
  30. attachMovie("register_button","register_b",5,{_x:-200,_y:300,name:"full"});
  31. attachMovie("register_name","register_name",6,{_x:800,_y:170,name:"name"});
  32. attachMovie("register_key","register_key",7,{_x:-200,_y:235,name:"key"});
  33. register_name.onEnterFrame = function()
  34. {
  35.    if(this.i < 200)
  36.    {
  37.       this.i = this.i + 1;
  38.    }
  39.    if(this.i > 5)
  40.    {
  41.       this.snapinplace(1,2,170,300);
  42.    }
  43.    if(this.i > 25)
  44.    {
  45.       register_key.snapinplace(1,2,235,300);
  46.    }
  47.    if(this.i > 45)
  48.    {
  49.       register_b.snapinplace(1,2,300,300);
  50.    }
  51.    if(this.i > 65)
  52.    {
  53.       demo.snapinplace(1,2,330,300);
  54.    }
  55. };
  56. Selection.setFocus("_root.nametext");
  57. captionbutton.prototype.onRollOver = function()
  58. {
  59.    _root.bubblenote.closer = false;
  60.    if(this.name == "demo")
  61.    {
  62.       this._y = 335;
  63.    }
  64.    if(this.name == "p_up")
  65.    {
  66.       this._y = 335;
  67.       this._x = 335;
  68.    }
  69.    if(this.name == "full")
  70.    {
  71.       this._y = 305;
  72.    }
  73.    if(!this.done)
  74.    {
  75.       this.addstar(this);
  76.       cap = attachMovie("bubblenote","bubblenote",200000,{_xscale:4,_yscale:4,_y:this._y + 5,_x:this._x + 10,acc:0.7,dec:3,destYs:101,destXs:101,destX:this._x + 110,_alpha:0});
  77.       cap.gotoAndStop(this.pos);
  78.       this.done = true;
  79.    }
  80. };
  81. captionbutton.prototype.onRelease = function()
  82. {
  83.    if(this.name == "demo")
  84.    {
  85.       trace(_root.plays);
  86.       _root.cap.removeMovieClip();
  87.       _root.gotoAndStop("intro");
  88.       _root.register_b.removeMovieClip();
  89.       _root.register_key.removeMovieClip();
  90.       _root.register_name.removeMovieClip();
  91.       _root.demo.removeMovieClip();
  92.    }
  93.    else
  94.    {
  95.       cap.gotoAndStop(4);
  96.    }
  97.    if(this.name == "full" and validateKey(_root.nametext,_root.registration) == true)
  98.    {
  99.       _root.registergame = true;
  100.       register_game();
  101.       _root.cap.removeMovieClip();
  102.       _root.gotoAndStop("intro");
  103.       _root.register_b.removeMovieClip();
  104.       _root.register_key.removeMovieClip();
  105.       _root.register_name.removeMovieClip();
  106.       _root.demo.removeMovieClip();
  107.    }
  108.    else
  109.    {
  110.       if(this.name == "full")
  111.       {
  112.          this._y = 305;
  113.       }
  114.       cap.gotoAndStop(3);
  115.    }
  116. };
  117. captionbutton.prototype.onRollOut = function()
  118. {
  119.    _root.bubblenote.closer = true;
  120.    _root.cap.removeMovieClip();
  121.    this.done = false;
  122. };
  123. bubblenote.prototype.onEnterFrame = function()
  124. {
  125.    if(this.closer == true)
  126.    {
  127.       this.destYs = 0;
  128.       this.destXs = 0;
  129.       if(this._xscale <= 0)
  130.       {
  131.          this.removeMovieClip();
  132.       }
  133.    }
  134.    this.onRollOut = function()
  135.    {
  136.       this.destYs = 0;
  137.       this.destXs = 0;
  138.       if(this._xscale <= 0)
  139.       {
  140.          this.removeMovieClip();
  141.       }
  142.    };
  143.    if(this.closer)
  144.    {
  145.       this.removeMovieClip();
  146.    }
  147.    if(!this.closer)
  148.    {
  149.       if(this._x < this.destx)
  150.       {
  151.          this.t = this.t + 1;
  152.          this._x += 35 / this.t;
  153.       }
  154.       if(this._xscale < 100)
  155.       {
  156.          this._xscale += 10;
  157.          this._yscale += 10;
  158.       }
  159.       if(this._alpha < 100)
  160.       {
  161.          this._alpha += 10;
  162.       }
  163.    }
  164.    else
  165.    {
  166.       this.removeMovieClip();
  167.    }
  168. };
  169.